<?php
/**
  * 网站配置参数模型
  */
class OptionsModel extends CommonModel
{
   /**
     * 添加网站设置
     * @access public
     * @param array $data 数据数组   
     * @return boolen
     */
    public function addOptions($data)
    {
		@$this->where('1=1')->delete();
		foreach($data as $k=>$v)
		{
			$d['option_name']=$k;
			$d['option_value']=$v;
			$this->data($d)->add();
		}
		return true;
    }

	/**
      * 获取网站全部参数
      * @access         public
      * @return         array
      */
	public function selectAllOptions()
	{
		$data=array();
		$temp=$this->select();
		foreach($temp as $v)
		{
			$data[$v['option_name']]=$v['option_value'];
		}
		return $data;
	}
}
?>